home *** CD-ROM | disk | FTP | other *** search
- import com.siemens.mp.game.Vibrator;
- import java.util.Random;
- import javax.microedition.lcdui.AlertType;
- import javax.microedition.lcdui.StringItem;
-
- class MaximaVolley$Ball extends Thread {
- public final int SIZE;
- private int xDir;
- private int yDir;
- // $FF: renamed from: x int
- int field_0;
- // $FF: renamed from: y int
- int field_1;
- // $FF: synthetic field
- private final MaximaVolley this$0;
-
- public MaximaVolley$Ball(MaximaVolley var1) {
- this.this$0 = var1;
- this.SIZE = 6;
- this.xDir = 1;
- this.yDir = -1;
- this.setUp(1);
- }
-
- void setUp(int var1) {
- if (var1 == 0) {
- this.field_0 = MaximaVolley.access$100(this.this$0).getWidth() - MaximaVolley.access$100(this.this$0).getWidth() / 4 - 4;
- this.field_1 = MaximaVolley.access$100(this.this$0).getHeight() - MaximaVolley.access$100(this.this$0).getHeight() / 4 - 2;
- } else {
- this.field_0 = MaximaVolley.access$100(this.this$0).getWidth() / 4;
- this.field_1 = MaximaVolley.access$100(this.this$0).getHeight() - MaximaVolley.access$100(this.this$0).getHeight() / 4;
- }
-
- }
-
- public void run() {
- Random var1 = new Random();
- this.this$0.rand = 0;
-
- label196:
- while(!MaximaVolley.access$400(this.this$0)) {
- MaximaVolley.access$502(this.this$0, System.currentTimeMillis());
- this.setUp(this.this$0.pr);
- MaximaVolley.access$602(this.this$0, 4);
- this.this$0.gol = 0;
- if (this.this$0.pr == 0) {
- this.xDir = -1;
- } else {
- this.xDir = 1;
- }
-
- this.yDir = -1;
- MaximaVolley.access$000(this.this$0).setUp(1);
- MaximaVolley.access$200(this.this$0).setUp(2);
- MaximaVolley.access$100(this.this$0).repaint(0, 0, MaximaVolley.access$100(this.this$0).getWidth(), MaximaVolley.access$100(this.this$0).getHeight());
-
- try {
- Thread.sleep(1000L);
- } catch (Exception var8) {
- return;
- }
-
- int var2;
- int var3;
- for(; this.this$0.p1 != 5 && this.this$0.p2 != 5; MaximaVolley.access$100(this.this$0).repaint(Math.min(var2, this.field_0), Math.min(var3, this.field_1) - 3, Math.abs(this.field_0 - var2) + 6 + 3, Math.abs(this.field_1 - var3) + 6 + 3)) {
- try {
- Thread.sleep((long)(150 - 10 * MaximaVolley.access$600(this.this$0)));
- } catch (Exception var13) {
- return;
- }
-
- var2 = this.field_0;
- var3 = this.field_1;
- int var5 = this.field_0 + this.xDir * MaximaVolley.access$600(this.this$0);
- int var6 = this.field_1 + this.yDir * MaximaVolley.access$600(this.this$0);
- if (var5 > MaximaVolley.access$100(this.this$0).getWidth() / 2 && var3 < var6) {
- if (this.this$0.rand == 0) {
- if (var5 + 5 < MaximaVolley.access$200(this.this$0).x) {
- MaximaVolley.access$200(this.this$0).move(-5);
- }
-
- if (var5 >= MaximaVolley.access$200(this.this$0).x + MaximaVolley.access$000(this.this$0).WIDTH && var2 < var5) {
- MaximaVolley.access$200(this.this$0).move(5);
- }
- } else {
- --this.this$0.rand;
- }
- }
-
- if ((System.currentTimeMillis() - MaximaVolley.access$500(this.this$0)) / 1000L >= 20L && MaximaVolley.access$600(this.this$0) < 10) {
- MaximaVolley.access$608(this.this$0);
- MaximaVolley.access$502(this.this$0, System.currentTimeMillis());
- }
-
- if (var5 + 6 <= MaximaVolley.access$100(this.this$0).getWidth() && var5 >= 0) {
- if (var5 + 6 >= MaximaVolley.access$100(this.this$0).getWidth() / 2 && var5 < MaximaVolley.access$100(this.this$0).getWidth() / 2) {
- if (var6 + 3 >= 2 * MaximaVolley.access$100(this.this$0).getHeight() / 3) {
- this.xDir *= -1;
- Vibrator.triggerVibrator(200);
- } else {
- this.this$0.touch = 0;
- this.this$0.touch1 = 0;
- }
- }
-
- this.field_0 = var5;
- } else {
- this.xDir *= -1;
- Vibrator.triggerVibrator(200);
- }
-
- if (var6 >= MaximaVolley.access$100(this.this$0).getHeight() / 15 + 16 && var6 + 6 <= MaximaVolley.access$100(this.this$0).getHeight() - MaximaVolley.access$000(this.this$0).HEIGHT - 2) {
- this.field_1 = var6;
- } else if (var6 + 6 > MaximaVolley.access$100(this.this$0).getHeight() - MaximaVolley.access$100(this.this$0).getHeight() / 3) {
- if (var5 <= MaximaVolley.access$000(this.this$0).x + MaximaVolley.access$000(this.this$0).WIDTH && var5 + 6 >= MaximaVolley.access$000(this.this$0).x && this.this$0.touch <= 2) {
- if (var5 + 3 <= MaximaVolley.access$000(this.this$0).x + MaximaVolley.access$000(this.this$0).WIDTH / 2 && var2 < var5) {
- this.xDir *= -1;
- }
-
- if (var5 + 3 >= MaximaVolley.access$000(this.this$0).x + MaximaVolley.access$000(this.this$0).WIDTH / 2 && var2 > var5) {
- this.xDir *= -1;
- }
-
- ++this.this$0.touch;
- this.this$0.touch1 = 0;
- this.yDir *= -1;
- AlertType.INFO.playSound(MaximaVolley.access$900(this.this$0));
- } else if (var5 <= MaximaVolley.access$200(this.this$0).x + MaximaVolley.access$200(this.this$0).WIDTH && var5 + 6 >= MaximaVolley.access$200(this.this$0).x && this.this$0.touch1 <= 2) {
- if (var5 + 3 <= MaximaVolley.access$200(this.this$0).x + MaximaVolley.access$200(this.this$0).WIDTH / 2 && var2 < var5) {
- this.xDir *= -1;
- }
-
- if (var5 + 3 >= MaximaVolley.access$200(this.this$0).x + MaximaVolley.access$200(this.this$0).WIDTH / 2 && var2 > var5) {
- this.xDir *= -1;
- }
-
- ++this.this$0.touch1;
- this.this$0.touch = 0;
- this.this$0.rand = Math.abs(var1.nextInt()) % 7;
- this.yDir *= -1;
- AlertType.INFO.playSound(MaximaVolley.access$900(this.this$0));
- } else {
- if (this.this$0.touch == 3) {
- this.this$0.touch = 0;
- if (this.this$0.pr == 0) {
- ++this.this$0.p1;
- }
-
- this.this$0.pr = 0;
- this.this$0.gol = 1;
- MaximaVolley.access$100(this.this$0).repaint(Math.min(var2, this.field_0), Math.min(var3, this.field_1) - 3, Math.abs(this.field_0 - var2) + 6 + 3, Math.abs(this.field_1 - var3) + 6 + 3);
-
- try {
- Thread.sleep(1000L);
- continue label196;
- } catch (Exception var12) {
- return;
- }
- }
-
- if (this.this$0.touch1 == 3) {
- this.this$0.touch1 = 0;
- if (this.this$0.pr == 1) {
- ++this.this$0.p2;
- }
-
- this.this$0.pr = 1;
- this.this$0.gol = 1;
- MaximaVolley.access$100(this.this$0).repaint(Math.min(var2, this.field_0), Math.min(var3, this.field_1) - 3, Math.abs(this.field_0 - var2) + 6 + 3, Math.abs(this.field_1 - var3) + 6 + 3);
-
- try {
- Thread.sleep(1000L);
- continue label196;
- } catch (Exception var11) {
- return;
- }
- }
-
- if (var5 < MaximaVolley.access$100(this.this$0).getWidth() / 2) {
- if (this.this$0.pr == 0) {
- ++this.this$0.p1;
- }
-
- this.this$0.pr = 0;
- this.this$0.gol = 1;
- MaximaVolley.access$100(this.this$0).repaint(Math.min(var2, this.field_0), Math.min(var3, this.field_1) - 3, Math.abs(this.field_0 - var2) + 6 + 3, Math.abs(this.field_1 - var3) + 6 + 3);
-
- try {
- Thread.sleep(1000L);
- continue label196;
- } catch (Exception var10) {
- return;
- }
- }
-
- if (var2 + 6 > MaximaVolley.access$100(this.this$0).getWidth() / 2) {
- if (this.this$0.pr == 1) {
- ++this.this$0.p2;
- }
-
- this.this$0.pr = 1;
- this.this$0.gol = 1;
- MaximaVolley.access$100(this.this$0).repaint(Math.min(var2, this.field_0), Math.min(var3, this.field_1) - 3, Math.abs(this.field_0 - var2) + 6 + 3, Math.abs(this.field_1 - var3) + 6 + 3);
-
- try {
- Thread.sleep(1000L);
- continue label196;
- } catch (Exception var9) {
- return;
- }
- }
- }
- } else if (var6 < MaximaVolley.access$100(this.this$0).getHeight() / 15 + 16) {
- this.yDir *= -1;
- Vibrator.triggerVibrator(200);
- }
- }
-
- MaximaVolley.access$402(this.this$0, true);
- MaximaVolley.access$708(this.this$0);
- if (this.this$0.p1 > this.this$0.p2) {
- MaximaVolley.access$800(this.this$0).append(new StringItem("Game " + MaximaVolley.access$700(this.this$0) + " over.", " Sorry, You lose!"));
- } else {
- MaximaVolley.access$800(this.this$0).append(new StringItem("Game " + MaximaVolley.access$700(this.this$0) + " over.", " My congratulation, You Win!"));
- }
-
- this.this$0.p1 = 0;
- this.this$0.p2 = 0;
- MaximaVolley.access$900(this.this$0).setCurrent(MaximaVolley.access$800(this.this$0));
- return;
- }
-
- }
- }
-